﻿function Validator() {
    return true;
}
function post_callback(res) {
    alert(res.message);
}
$(function () {
    var frm = $("form");
    frm.submit(function () {
        if (Validator()) {
            $.post(frm.attr("action"), frm.serialize(), function (resp) {
                post_callback(resp);
            }, "json");
        }
        return false;
    });
});